#ifndef CCONTROL_H
#define CCONTROL_H

#include "cHwnd.h"
#include <stdio.h>
#include <string.h>
using namespace std;

struct ancreSimple{
    bool ancrer;
    int  offset;
};

struct ANCHOR{
    ancreSimple left;
    ancreSimple right;
    ancreSimple top;
    ancreSimple bottom;
};


class cControl : public cHwnd
{
    public:
        cControl(cHwnd * parent);
        virtual ~cControl();
        static              LRESULT CALLBACK ChildProc(HWND hwnd, unsigned int message, WPARAM wParam, LPARAM lParam);
        bool       ResizingParentChild(HWND hwndChild,LPARAM rectangle);
        void                SetTooltip(string resume);
        void                SetFont(LPCSTR familly,int size,int weight,bool italic=false,bool underline=false);
        void                SetFont(HFONT font);
        ANCHOR              anchors;
        void                SetAncre(string cardinal,bool actif,int offset);



    protected:

        void                FinalInit();
        virtual bool         TraitementEvent(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam,LRESULT & resultat)=0;
        cHwnd *             _parent;


    private:
        LRESULT CALLBACK    childProcSimple(HWND hwnd, unsigned int message, WPARAM wParam, LPARAM lParam);
        HWND                hWndTooltip;

};

#endif // CCONTROL_H
